<include file="Public/header" />
<title>企业管理</title>
</head>
<body>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <form class="formleft" name="" id="" action="__URL__/ems/" method="get">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['order_no']}>" placeholder="订单编号" name="order_no">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['logistics_no']}>" placeholder="电子面单号" name="logistics_no">
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>
		</form>
		<span class="r">共有数据：<strong><{$count}></strong> 条</span> 
    </div>
    <div class="mt-20">
		<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="15">订单列表</th>
			</tr>
			<tr class="text-c">
				<th width="25" class="sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 25px;"><input type="checkbox" name="" value=""></th>
				<th>序号</th>
				<th width="">订单编号</th>
				<th width="">电子面单号</th>
				<th width="">收件人姓名</th>
				<th width="">身份证号</th>
				<th width="">收件人电话</th>
				<th width="">收件人地址</th>
				<th width="">状态</th>
				<th width="">推送时间</th>
				<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><input type="checkbox" value="<{$vo.id}>" name="" class="ids"></td>
				<td><{$i}></td>
				<td><{$vo.order_no}></td>
				<td><{$vo.logistics_no}></td>
				<td><{$vo.user_name}></td>
				<td><{$vo.user_idcard}></td>
				<td><{$vo.user_phone}></td>
				<td><{$vo.province}><{$vo.city}><{$vo.area}><{$vo.user_address}></td>
				<td>
				<if condition="$vo.flag eq 1">
					<img src="__PUBLIC__/img/flag/flag_green.png">
				</if>
				<if condition="$vo.flag eq 2">
					<img src="__PUBLIC__/img/flag/flag_yellow.png">
					
				</if>
				<if condition="$vo.flag eq 3">
					<img src="__PUBLIC__/img/flag/flag_red.png">
				</if>
				</td>
				<td><{$vo.add_time|date="Y-m-d",###}></td>
				<td>
				<a href="javascript:;" onclick="admin_open('快递状态','__URL__/ems_log/order_id/<{$vo.id}>/user_id/<{:I('user_id')}>','<{$vo.id}>','800','480')" class="">快递状态</a>
				</td>
			</tr>
			</volist>			
		</tbody>
	</table>
	<div class="page mt" style="text-align:right"><{$page}></div>
</div>
<include file="Public/footer" />
<include file="Public/footer_js" />
<script>
	//扣月租
	function month_rent(){
			var option = $(".ids");
			var checked_counts=0;
			var check_val = [];
            for(var i=0;i<option.length;i++){
				if(option[i].checked){
					checked_counts++;
					check_val.push(option[i].value);
				}
			}
			if(checked_counts!=1){
				layer.msg('一次只能选中一个');
				return false;
			}else{
				$.post('__MODULE__/Member/month_rentss',{
					id:check_val[0],
				},function (msg){
					layer.msg(msg.message);
					if(msg.status==1){
						setTimeout(function (){
							location.reload();
						},800);
					}
				},'json');
			}
	}

	function examined(val){
			var option = $(".ids");
			var checked_counts=0;
			var check_val = [];
            for(var i=0;i<option.length;i++){
				if(option[i].checked){
					checked_counts++;
					check_val.push(option[i].value);
				}
			}
			<!-- alert(check_val); -->
			if(checked_counts==0){
				layer.msg('至少选中一个');
				return false;
			}else{
				 $.post('__CONTROLLER__/examined',{
					ids:check_val,
					val:val
				},function(msg){
					layer.msg(msg.data,function(){
						location.reload();
					});
				},'json');
			}
	}
	function bind_feerule(){
			var option = $(".ids");
			var checked_counts=0;
			var check_val = [];
			for(var i=0;i<option.length;i++){
				if(option[i].checked){
					checked_counts++;
					check_val.push(option[i].value);
				}
			}
			if(checked_counts==0){
				layer.msg('至少选中一个');
				return false;
			}else{
				var index=layer.open({
				  title: '选择费用规则',
				  type: 2,
				  area: ['320px', '280px'], //宽高
				  content: '__MODULE__/Company/bind_feerule/ids/'+check_val //iframe的url
				});
				
			}
	}
	function bind_member(){
			var option = $(".ids");
			var checked_counts=0;
			var check_val = [];
            for(var i=0;i<option.length;i++){
				if(option[i].checked){
					checked_counts++;
					check_val.push(option[i].value);
				}
			}
			if(checked_counts==0){
				layer.msg('至少选中一个');
				return false;
			}else{
				var index=layer.open({
				  title: '选择会员',
				  type: 2,
				  area: ['300px', '280px'], //宽高
				  content: '__MODULE__/Company/bind_member/ids/'+check_val //iframe的url
				});
				
			}
    }
	function bind_role(){
			var option = $(".ids");
			var checked_counts=0;
			var check_val = [];
            for(var i=0;i<option.length;i++){
				if(option[i].checked){
					checked_counts++;
					check_val.push(option[i].value);
				}
			}
			if(checked_counts==0){
				layer.msg('至少选中一个');
				return false;
			}else{
				var index=layer.open({
				  title: '选择角色组',
				  type: 2,
				  area: ['300px', '280px'], //宽高
				  content: '__MODULE__/Company/bind_role/ids/'+check_val //iframe的url
				});
				
			}
    }
    $("#search").click(function (){
        location.href="__CONTROLLER__/index/name/"+$("#name").val();
    });
    function add(){
        var index=layer.open({
            type: 2,
            title: '企业添加',
            shadeClose: true,
            shade: 0.5,
            area: ['400px', '400px'],
            content: '__MODULE__/Company/add' //iframe的url
        });
    }
	//清空数据
	function truncateAll(id){
		<!-- alert(id); -->
		layer.confirm('点击确定将清空此erp数据库数据', {
		  btn: ['确定','取消']//按钮
		}, function(index){
			layer.close(index);
			layer.open({
			  type: 2,
			  title: '清空数据',
			  shadeClose: true,
			  shade: 0.8,
			  area: ['380px', '90%'],
			  content: "__MODULE__/Company/truncateAll/id/"+id //iframe的url
			});
		});
	}
	//数据升级
	function updateAll(_this){
		layer.confirm('点击确定将升级所有erp数据库', {
		  btn: ['确定','取消'] //按钮
		}, function(index){
			layer.close(index);
			layer.open({
			  type: 2,
			  title: '数据导入',
			  shadeClose: true,
			  shade: 0.8,
			  area: ['380px', '90%'],
			  content: '__MODULE__/Company/updateAll' //iframe的url
			});
		});
	}
    function edit(id){
        var index=layer.open({
            type: 2,
            title: '企业修改',
            shadeClose: true,
            shade: 0.5,
            area: ['400px', '400px'],
            content: '__MODULE__/Company/edit/id/'+id //iframe的url
        });
    }
	function ems(id){
        var index=layer.open({
            type: 2,
            title: '订单列表',
            shadeClose: true,
            shade: 0.5,
            area: ['400px', '400px'],
            content: '__MODULE__/Company/order/user_id/'+id //iframe的url
        });
    }
    function warehouse(id){
        var index=layer.open({
            type: 2,
            title: '仓库管理',
            shadeClose: true,
            shade: 0.8,
            area: ['380px', '90%'],
            content: '__MODULE__/Company/warehouse/id/'+id //iframe的url
        });
        layer.full(index);
    }
    function delAll(){
        var all_ipt=$("#DataTables_Table_0_wrapper input[type=checkbox]:checked");
        var group_id='';
        for(var i=0;i<all_ipt.length;i++){
            if(all_ipt.eq(i).val()!==''){
                group_id+='@'+all_ipt.eq(i).val();
            }
        }
        if(group_id.substring(1)==''){
            layer.msg('请勾选要删除的信息');
            return false;
        }
        del(group_id.substring(1));
    }
    function del(id){
        $.get('__MODULE__/Company/del',{
            id:id,
        },function (msg){
            layer.msg(msg.data);
            if(msg.flag==1){
                setTimeout(function (){
                    location.reload();
                },800);
            }
        },'json');
    }
</script>
</body>
</html>